package lab01;

public class Test10 {

    public static void main(String[] args) {
        int i = 1;
        char a = 'A';
        //打印菱形上半部分
        for (int l = 1; l <= 4; l++) {
            //打印每一行前面的空格
            for (int r = 1; r <= 4 - l; r++) {
                System.out.print(" ");
            }
            //打印每行字母
            for (int j = 1; j <= l; j++) {
                System.out.print(a);
                System.out.print(" ");
                a = (char) (a + i);
            }
            System.out.println();
        }
        //打印菱形下半部分
        for (int l = 4; l >= 1 - 1; l--) {
            //打印每一行前面的空格
            for (int r = 1; r <= 4 - l; r++) {
                System.out.print(" ");
            }

            //打印每行字母
            for (int j = 1; j <= l; j++) {
                a = (char) (a + i);
                System.out.print(a);
                System.out.print(" ");
            }
            System.out.println();
        }
    }
}

